import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Font;
import java.awt.Label;
import java.awt.TextField;


public class PersonInfoDialog extends JDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final JPanel contentPanel = new JPanel();
	private TextField txt_name;
	private TextField txt_addres;
	private TextField txt_tel;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			PersonInfoDialog dialog = new PersonInfoDialog();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void setName(String name) {
		txt_name.setText(name);
	}

	public void setAddres(String addres) {
		txt_addres.setText(addres);
	}

	public void setTel(String tel) {
		txt_tel.setText(tel);
	}

	/**
	 * Create the dialog.
	 */
	public PersonInfoDialog() {
		setFont(new Font("Dialog", Font.PLAIN, 14));
		setBounds(100, 100, 450, 300);
		getContentPane().setLayout(null);
		contentPanel.setBounds(0, 0, 442, 237);
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel);
		contentPanel.setLayout(null);
		{
			Label label = new Label("\u4F60\u7684\u59D3\u540D:");
			label.setFont(new Font("Dialog", Font.PLAIN, 14));
			label.setBounds(38, 31, 65, 23);
			contentPanel.add(label);
		}
		{
			Label label = new Label("\u4F60\u7684\u5730\u5740:");
			label.setFont(new Font("Dialog", Font.PLAIN, 14));
			label.setBounds(38, 82, 65, 23);
			contentPanel.add(label);
		}
		{
			Label label = new Label("\u4F60\u7684\u96FB\u8A71:");
			label.setFont(new Font("Dialog", Font.PLAIN, 14));
			label.setBounds(38, 134, 65, 23);
			contentPanel.add(label);
		}
		{
			txt_name = new TextField();
			txt_name.setFont(new Font("Dialog", Font.PLAIN, 14));
			txt_name.setBounds(109, 31, 195, 23);
			contentPanel.add(txt_name);
		}
		{
			txt_addres = new TextField();
			txt_addres.setFont(new Font("Dialog", Font.PLAIN, 14));
			txt_addres.setBounds(109, 82, 195, 23);
			contentPanel.add(txt_addres);
		}
		{
			txt_tel = new TextField();
			txt_tel.setFont(new Font("Dialog", Font.PLAIN, 14));
			txt_tel.setBounds(109, 134, 195, 23);
			contentPanel.add(txt_tel);
		}
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setBounds(0, 237, 442, 35);
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane);
			{
				JButton okButton = new JButton("OK");
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
			{
				JButton cancelButton = new JButton("Cancel");
				cancelButton.setActionCommand("Cancel");
				buttonPane.add(cancelButton);
			}
		}
	}

}
